
<xsl:stylesheet version="2.0"
			xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
			xmlns:java="java" 
	>
	<xsl:output omit-xml-declaration="yes"/>
	<xsl:template match="/Data">
	<xsl:variable name="rb"
              select="java:util.ResourceBundle.getBundle('bundle')"/>
    <xsl:variable name="joomlaHost"><xsl:value-of select="java:getString($rb,'JOOMLA_HOST')"/></xsl:variable>
	<xsl:variable name="findButton"><xsl:value-of select="java:getString($rb,'PANEL_FIND_FIND')"/></xsl:variable>
	
	<xsl:variable name="cvLink"><xsl:value-of select="CV" /></xsl:variable>
	
	<xsl:variable name="deleteTooltip"><xsl:value-of select="java:getString($rb,'TOOLTIP_DELETE')"/></xsl:variable>
	<xsl:variable name="editTooltip"><xsl:value-of select="java:getString($rb,'TOOLTIP_EDIT')"/></xsl:variable>
	<xsl:variable name="panelTooltip"><xsl:value-of select="java:getString($rb,'TOOLTIP_PANEL')"/></xsl:variable>
	
	<xsl:variable name="cvTooltip"><xsl:value-of select="java:getString($rb,'TOOLTIP_CV')"/></xsl:variable>
	
	<div>
		
		<a href="#" onClick="Javascript:filterPanel()" id="filtersButton">
			<xsl:value-of select="java:getString($rb,'SEARCH_FILTER')"/>
		</a>
		<span id="findFilters" style="display:none;">
			<table id="formPanelTable">
					 
					<tr>
						<th scope="col" class="colLabel"></th>
						<th scope="col" class="colField"></th>
						<th scope="col" class="colLabel"></th>
						<th scope="col" class="colField"></th>
						<th scope="col" class="colLabel"></th>
						<th scope="col" class="colField"></th>
					</tr>
					<tr>
						<td>
							<label for='name' class='filter_label'>
								<xsl:value-of select="java:getString($rb,'CANDIDACY_NAME')"/>:
							</label>
						</td>
						<td>
							<input 	type='input' name='name' id='name' 
									class='user_input' style='display:inline;' 
									size='25' value='{AltData/Candidato/Name}' 
							/>
						</td>
					
						<td>
							<label for='name' class='filter_label'>
								<xsl:value-of select="java:getString($rb,'CANDIDACY_COGNOME')"/>:
							</label>
						</td>
						<td>
							<input 	type='input' name='cognome' id='cognome'
								 	class='user_input' style='display:inline;' 
								 	size='25' value='{AltData/Candidato/Cognome}'
							/>
						</td>
						<td>
							<label for='name' class='filter_label'>
								<xsl:value-of select="java:getString($rb,'CANDIDACY_EMAIL')"/>:
							</label>
						</td>
						<td>
							<input 	type='input' name='email' id='email' 
									class='user_input' style='display:inline;' 
									size='25' value='{AltData/Candidato/Email}' 
							/>
						</td>
					</tr>
					<tr>
						<td>
							<label for='select_skill' class='filter_label'><xsl:value-of select="java:getString($rb,'CANDIDACY_SKILL')"/>:</label>
						</td>
						<td>
							<select name="select_skill" id='select_skill' 
									class='user_input'  
									onChange="javascript:setHiddenField('skill',this.value)"
							>
								<option>
									<xsl:attribute name="value">
									    
									</xsl:attribute>
								</option>
								 <xsl:for-each select="AltData/Candidato/Skills/*">
									 <option>
										  <xsl:attribute name="value">
										    <xsl:value-of select="name()"/>
										  </xsl:attribute>
										  
										  <xsl:if test="self::node()/@selected='true'">
										  	<xsl:attribute name="selected">
										    	selected
										  	</xsl:attribute>
										  </xsl:if>
										  
										  <xsl:value-of select="self::node()[text()]"/>
									 </option>
								 </xsl:for-each>
								 <script>
									setHiddenField('skill',this.value);
								</script>
							</select>					
							<input type='hidden' name='skill' id='skill' class='user_input' size='25' />
						</td>
						<td>
							<label for='name' class='filter_label'>
								<xsl:value-of select="java:getString($rb,'CANDIDACY_FROM')"/>:
							</label>
						</td>
						<td>
							<input 	type='input' name='dateStart1' id='dateStart1' 
									class='user_input' style='display:inline;' 
									size='25' value='{AltData/Candidato/CreatoDal}' 
							/>
						</td>
						<td>
							<label for='name' class='filter_label'>
								<xsl:value-of select="java:getString($rb,'CANDIDACY_TO')"/>:
							</label>
						</td>
						<td>
							<input 	type='input' name='dateStart2' id='dateStart2' 
									class='user_input' style='display:inline;' 
									size='25' value='{AltData/Candidato/CreatoAl}' 
							/>
							
						</td>
						
					</tr>
				</table>
				<table>
					<tr>
						<th scope="col" ></th>
						<th scope="col" ></th>
						<th scope="col" ></th>
					</tr>
					<tr>
						<td>
							<label for='cv' class='filter_label'>
								<xsl:value-of select="java:getString($rb,'CANDIDACY_RICERCA_FILE')"/>:
							</label>
						</td>
						<td>
							<label>
								<input 	type="checkbox" class="user_input" name="ricercaSuFile" 
										style="display: inline;margin: 0 10px;"
										onClick="javascript:checkFileSearch()" value='{AltData/Candidato/CheckToSearch}'
										id="ricercaSuFile"
								>
									  <xsl:if test="AltData/Candidato/CheckToSearch=1">
									  	<xsl:attribute name="checked">
									    	checked
									  	</xsl:attribute>
									  </xsl:if>
								</input>
							</label>
						</td>
						<td>
							<div>
						
								<xsl:if test="AltData/Candidato/TextToSearch!=''">
									<textarea 	class="user_input" rows="20" cols="50" id="textToSearch"
												name="textToSearch" 
												style=	"	display: inline; margin: 0px 10px; 
															height: 50px;width: 360px;resize: none;
														" 
												value='{AltData/Candidato/TextToSearch}'
									>
										<xsl:if test="AltData/Candidato/CheckToSearch=0">
										  	<xsl:attribute name="disabled">
										    	disabled
										  	</xsl:attribute>
									  	</xsl:if>
										<xsl:value-of select="AltData/Candidato/TextToSearch"/>
									</textarea>
								</xsl:if>
								<xsl:if test="AltData/Candidato/TextToSearch=''">
									<textarea 	class="user_input" rows="20" cols="50" id="textToSearch"
												name="textToSearch" 
												style=	"	display: inline; margin: 0px 10px; 
															height: 50px;width: 360px;resize: none;
														" 
												value=''
									>
										<xsl:if test="AltData/Candidato/CheckToSearch=0">
										  	<xsl:attribute name="disabled">
										    	disabled
										  	</xsl:attribute>
									  	</xsl:if>
										<xsl:text> </xsl:text>
									</textarea>
								
								</xsl:if>
								
							</div>	
						</td>
					</tr>
			</table>
			<a 	href="#" id="searchButton"
				onClick="javascript:getCheckedTarget('dateStart1','dateStart2','candidato.find','target','','ListaCandidature')"
			>
				<xsl:value-of select="$findButton"/>
			</a>
<!-- 			<input type="button" name="find" id="find"  -->
<!-- 				onClick="javascript:getCheckedTarget('dateStart1','dateStart2','candidato.find','target','','ListaCandidature')"  -->
<!-- 				value="{$findButton}"  -->
<!-- 			/> -->
			
				
				
		
		</span>
		<table 	width="100%" id="candidatoListTable" cellspacing="0" >
			<caption><xsl:value-of select="java:getString($rb,'TOOLTIP_LIST_CV')"/></caption>
			<tr>	
				<th scope="col" class="icon"></th>
				<th scope="col" class="icon"></th>
				<th scope="col" class="icon"></th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'CANDIDACY_DATESTART')"/>
				</th>
				
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'CANDIDACY_COGNOME')"/>
				</th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'CANDIDACY_NAME')"/>
				</th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'CANDIDACY_BIRTHDATE')"/>
				</th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'CANDIDACY_CONTRATTO')"/>
				</th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'CANDIDACY_RETRIBUZIONE')"/>
				</th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'CANDIDACY_SKILL')"/>
				</th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'PANEL_DATA_COLLOQUIO')"/>
				</th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'PANEL_GIORNI_PREAVVISO')"/>
				</th>
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'PANEL_CLIENTE_FINALE')"/>
				</th>
				
				<th scope="col">
						<xsl:value-of select="java:getString($rb,'CANDIDACY_CV')"/>
				</th>
			</tr>
	
			<xsl:for-each select="Candidati/Candidato">
				<xsl:variable name="rowClass">
	                <xsl:choose>
	                    <xsl:when test="position() mod 2 = 0">altRow</xsl:when>
	                    <xsl:otherwise>normalRow</xsl:otherwise>
	                </xsl:choose>
                </xsl:variable>
				<tr class="{$rowClass}">
					<td class="icon">
						<input type='hidden' name='row_{ID}' id='row_{ID}' class='' size='0' />
						<a 	href="javascript:getTarget('candidato.delete','target',{ID},'Candidato')" 
							id="delete_list_button" title="{$deleteTooltip}"
						>
							<img src="./img/del.gif" />
						</a>
						
					</td>
					
					<td class="icon">
						<a 	href="javascript:getTarget('candidato.load','target',{ID},'Candidato')" 
							id="edit_list_button" title="{$editTooltip}"
							
						>
							<img src="./img/edit.gif" />
						</a>
						
					</td>
					
					<td class="icon">
						<a 
							href="javascript:getTarget('gestioneCandidato.load','target',{ID},'GestioneCandidato')" 
							id="edit_list_button" title="{$panelTooltip}"
						>
							<img src="./img/panel.gif" />
						</a>
						
					</td>
					<td >
						<xsl:value-of select="DataCreazione" />
					</td>
					<td class="left">
						<xsl:value-of select="Cognome" />
					</td>
					<td class="left">
						<xsl:value-of select="Name" />
					</td>
					<td>
						<xsl:value-of select="DataNascita" />
					</td>	
					<td>

						<xsl:for-each select="Contratto/*">
				
							<xsl:if test="self::node()/@selected='true'">
						   		<xsl:value-of select="self::node()[text()]"/>
						  	</xsl:if>
	
						</xsl:for-each>

					</td>
					<td>
						<xsl:value-of select="Salario" />
					</td>
									
					
					<td>
						<xsl:for-each select="Skills/*">
							<xsl:if test="self::node()/@selected='true'">
						   		<xsl:value-of select="self::node()[text()]"/>
						  	</xsl:if>
						</xsl:for-each>
					
					</td>
					<td>
						<xsl:value-of select="DataColloquio" />
					</td>
					<td>
						<xsl:value-of select="GiorniPreavviso" />
					</td>
					<td>
						<xsl:if test="ClienteFinale!=''">
							<div class="popup_box" id="popup_box_{ID}">
								<span>
									<p>
										<xsl:value-of select="ClienteFinale" />
									</p>
								</span>
					    		<a href="#" class="buttonClose" id="buttonClose_{ID}"  onclick="hidePopup({ID})">
					    			<xsl:value-of select="java:getString($rb,'HIDE_POPUP')"/>
					    		</a>
							</div>    
							<div class="popup_hider" id="popup_hider_1">
							    <a href="#" class="showpopup" id="showpopup_{ID}" onclick="showPopup({ID})">
							    	<xsl:value-of select="java:getString($rb,'SHOW_POPUP')"/>
							    </a>
							</div>
						</xsl:if>
					</td>
					
					<td class="icon">			
						
						<xsl:choose>
						    <xsl:when test="CV!=''">
								<a 	href="{$joomlaHost}{CV}" 
									target="_new" title="{$cvTooltip} {Cognome} {Name}"
								>
									<img src="./img/cv.gif" />
								</a>
						    </xsl:when>
						    <xsl:otherwise>
								
						    </xsl:otherwise>
						</xsl:choose>
					
						
					</td>
				</tr>
				
			</xsl:for-each>
	</table>

	</div>
	</xsl:template>
</xsl:stylesheet>